<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <style type="text/css">
        table {
            border-collapse: collapse;
            font-size: 14px;
            width: 80%;
            margin: auto
        }

        table, th, td {
            border: 1px solid darkslategray;
            padding: 10px
        }
    </style>
</head>
<body>
<div style="text-align: center">
    <span style="color: darkslategray; font-size: 30px">欢迎光临！</span>
    <hr/>
    <form action="add.html" method="post">
        <input type="submit" value="添加">
        <table class="list">
            <tr>
                <th>id</th>
                <th>姓名</th>
                <th>年龄</th>
                <th>地址</th>
                <th>时间</th>
                <th>操作</th>
            </tr>
            <tr th:each="user : ${list}">
                <td th:text="${user.id}"></td>
                <td th:text="${user.name}"></td>
                <td th:text="${user.age}"></td>
                <td th:text="${user.adderss}"></td>
                <td th:text="${#dates.format(user.createtime,'yyyy-MM-dd')}"></td>
                <td>
                    <a th:href="@{/user/delete(id=${user.id})}">删除</a>
                    <a th:href="@{/user/findById(id=${user.id})}">修改</a>
                </td>
            </tr>
        </table>

    </form>
</div>
</body>
</html>